package com.bh.wms.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bh.common.annotation.Excel;
import com.bh.common.core.domain.BhtmsBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.util.Date;
import java.util.List;

/**
 * 入库单
 *
 * @author GPT
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_inbound_order")
@ApiModel(value = "入库单", description = "入库业务单据")
public class WmsInboundOrder extends BhtmsBaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("入库单号")
    @Excel(name = "入库单号")
    private String orderNo;

    @ApiModelProperty("入库类型")
    @Excel(name = "入库类型")
    private String orderType;

    @ApiModelProperty("来源单号")
    @Excel(name = "来源单号")
    private String sourceOrderNo;

    @ApiModelProperty("货主ID")
    @Excel(name = "货主ID")
    private Long ownerId;

    @ApiModelProperty("仓库ID")
    @Excel(name = "仓库ID")
    private Long warehouseId;

    @ApiModelProperty("预计到货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date expectArriveTime;

    @ApiModelProperty("实际到货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "实际到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date actualArriveTime;

    @ApiModelProperty("入库状态 created/receiving/received/closed")
    @Excel(name = "状态")
    private String orderStatus;

    @ApiModelProperty("质检状态 pending/pass/reject")
    @Excel(name = "质检状态")
    private String qcStatus;

    @ApiModelProperty("总件数")
    @Excel(name = "总件数")
    private Integer totalQuantity;

    @ApiModelProperty("总重量(kg)")
    @Excel(name = "总重量(kg)")
    private Double totalWeight;

    @ApiModelProperty("总体积(m³)")
    @Excel(name = "总体积(m³)")
    private Double totalVolume;

    @ApiModelProperty("承运商ID预留")
    private Long carrierId;

    @ApiModelProperty("运输单号预留")
    private String transportNo;

    @ApiModelProperty("外部回执状态")
    private String externalStatus;

    @TableField(exist = false)
    @ApiModelProperty("入库明细")
    private List<WmsInboundOrderDetail> details;
}

